package com.future.hedongjun.mall.activity;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.future.baselib.activity.BaseListActivity;
import com.future.hedongjun.mall.adapter.EvaluateAdapter;
import com.future.hedongjun.mall.bean.EvaluateBean;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;
import java.util.TreeMap;

public class EvaluateActivity extends BaseListActivity {

    private String id;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setTitle("全部评价");
    }

    @Override
    protected BaseQuickAdapter getAdapter() {
        return new EvaluateAdapter(initTestData());
    }

    private List<EvaluateBean> initTestData() {
        List<EvaluateBean> data = new ArrayList<>();
        for (int i = 0; i < 20; i++) {
            EvaluateBean bean = new EvaluateBean();
            bean.imgUrl = "http://seopic.699pic.com/photo/50025/2423.jpg_wh1200.jpg";
            bean.name = "小芳";
            bean.time = "11-19 11:00";
            bean.content = "村里有个菇凉叫小芳，长得又丑满脸疮";
            data.add(bean);
        }
        return data;
    }

    @Override
    protected void getBundleExtras(Bundle extras) {
        super.getBundleExtras(extras);
        id = extras.getString("id");
    }

    @Override
    protected Type getTypeToken() {
        return null;
    }

    @Override
    protected TreeMap<String, String> getRequestParams() {
        TreeMap<String, String> map = new TreeMap<>();
        map.put("id", id);
        return map;
    }

    @Override
    public void onItemClick(BaseQuickAdapter adapter, View view, int position) {

    }
}
